package DesignPatern.A20_状态模式.QSB.A02_抽象模式;

/**
 * @Author: Du
 * @Date: 2021/8/6 14:09
 */
public class Context
{
    public final static State STATE1 = new ConcreteState1();
    public final static State STATE2 = new ConcreteState2();
    
    public State CurrentState;
    
    public void setCurrentState(State currentState)
    {
        this.CurrentState = currentState;
        this.CurrentState.setContext(this);
    }
    
    public void handle1()
    {
        this.CurrentState.handle1();
    }
    
    public void handle2()
    {
        this.CurrentState.handle2();
    }
}
